package com.ddtech.business.check.controller;


import com.ddtech.business.check.query.CheckUserRecordQuery;
import com.ddtech.business.check.service.CheckUserRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 学员考核记录表 前端控制器
 * </p>
 *
 * @author bin_pu
 * @since 2023-02-06
 */
@Api(tags = "业务-学员考核记录")
@RestController
@RequestMapping("/check/user-record")
public class CheckUserRecordController {
    @Autowired
    private CheckUserRecordService checkUserRecordService;

    @ApiOperation(value = "查询考核列表")
    @GetMapping(value = "/page-list")
    public ResponseEntity getPageList(CheckUserRecordQuery checkUserRecordQuery) {
        return new ResponseEntity(checkUserRecordService.pageList(checkUserRecordQuery), HttpStatus.OK);
    }

    @ApiOperation(value = "APP考试库首页考试数据统计")
    @GetMapping(value = "/check-statistics-app")
    public ResponseEntity getStatisticsApp() {
        return new ResponseEntity(checkUserRecordService.getStatisticsApp(), HttpStatus.OK);
    }

    @ApiOperation(value = "APP考试库安排，待考试、已参加考试")
    @GetMapping(value = "/check-plan-statistics-app")
    public ResponseEntity checkPlanStatisticsApp(@ApiParam("类型:1考试,2竞赛")  Integer checkType) {
        return new ResponseEntity(checkUserRecordService.checkPlanStatisticsApp(), HttpStatus.OK);
    }
}
